/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package PL3;

import Gramatica.SimboloTerminal;

/**
 *
 * @author David Fernandez <david@gluem.org>
 * @version 0.1
 */
public class Token {

    private int codigo;
    private SimboloTerminal valor;
    private int fila;
    private int columna;

    public static final int ID = 1;
    public static final int NUM = 2;
    public static final int SUMA = 3;
    public static final int MULTIPLICACION = 4;




    public Token(String valor, int fila, int columna){

        //this.codigo = codigo;
        this.valor = new SimboloTerminal(valor);
        this.fila = fila;
        this.columna = columna;
    }

    public Token(String valor){

        codigo = 0;
        this.valor = new SimboloTerminal(valor);
        fila = 0;
        columna = 0;
    }

    /**
     * @return the codigo
     */
    public int getCodigo() {
        return codigo;
    }

    /**
     * @param codigo the codigo to set
     */
    public void setCodigo(int codigo) {
        this.codigo = codigo;
    }

    /**
     * @return the valor
     */
    public SimboloTerminal getValor() {
        return valor;
    }

    /**
     * @param valor the valor to set
     */
    public void setValor(SimboloTerminal valor) {
        this.valor = valor;
    }

    public void setValor(String valor){

        this.valor = new SimboloTerminal(valor);
    }


    public String toString(){

        return "["+fila+","+columna+"] ---> " + codigo + " : " + valor;
    }

}
